<%--
The Community Project
Copyright Team1 Productions

Joshua Amick
Stephen Cunningham
Thema Davis
Tomika Dawson
Lucie DeCristifaro

This JSP is an implementation of the user interface for the Community Project.  Several
tag libraries and custom libraries are used.

All Rights reserved.
--%>

<%@ page %>
<%@ page contentType="text/html"%>
<%@ page pageEncoding="UTF-8"%>

<%-- jstl taglibs --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%-- struts taglibs --%>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %>
<%-- custom taglib by Josh --%>
<%@ taglib prefix="custom" tagdir="/WEB-INF/tags/custom" %>
<%-- Display tag --%>
<%@ taglib prefix="display" uri="http://displaytag.sf.net/el" %>


<c:set var="basePath">
	${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}
</c:set>
<c:set var="servletPath">
	${pageContext.request.servletPath}
</c:set>

<c:set var="groupName">
	Team 1
</c:set>

<base href="${basePath}/" />
<custom:frame>
<link rel="stylesheet" type="text/css" href="${basePath}/css/displaytag.css">
	<div class="styleTitleClass">Welcome back, ${AUTH_USER.username}!</div>
	<div>Welcome to the Main Page of the ${groupName} community website.  You can create your own profile and stay up to date
	with announcements and events for this group.  This site is meant to promote group functions and activity.  We hope you enjoy this
	product.</div><br/>
	
	<div class="tableHeader">Announcements</div>
	<c:choose>
		<c:when test="${not empty ANNOUNCEMENTS}">
			<display:table name="ANNOUNCEMENTS">
			  <display:column property="startDate" title="Date" />
			  <display:column property="announcementTitle" title="Title" />
			  <display:column property="announcementDescription" title="Description" />
			</display:table>
		</c:when>
		<c:otherwise>
			<p>There are no announcements to display at this time.</p>
		</c:otherwise>
	</c:choose>
	
	<div class="tableHeader">Upcoming Events</div>
	<c:choose>
		<c:when test="${not empty EVENTS}">
			<display:table name="EVENTS">
			  <display:column property="startDate" title="Date" />
			  <display:column property="eventTitle" title="Title" />
			  <display:column property="eventLocation" title="Location" />
			  <display:column property="eventDescription" title="Description" />
			</display:table>
		</c:when>
		<c:otherwise>
			<p>There are no events to display at this time.</p>
		</c:otherwise>
	</c:choose>
	
</custom:frame>
